#pragma once
#include "ConnectionHandler.h"
class Connection;
class ConnectionFilter;
class ConnectionFilterHandler {
public:
	virtual void onFilterData(ConnectionFilter* filter, void* data, int len) = 0;
};
class ConnectionFilter : public ConnectionHandler
{
public:
	ConnectionFilter(Connection* conn);
	void setHandler(ConnectionFilterHandler* filter);
	void sendData(char* data, int len);
	virtual void onData(Connection* conn);
	virtual void onConnected(Connection* conn);
	virtual void onClose(Connection* conn);
private:
	ConnectionFilterHandler* m_handler;
	Connection* m_conncetion;
};
